package com.sk.tools.excel.meta.model;

import com.fasterxml.jackson.databind.annotation.JsonDeserialize;
import com.fasterxml.jackson.databind.annotation.JsonSerialize;
import com.sk.tools.excel.meta.model.ser.ValidatorJsonDeserializer;
import com.sk.tools.excel.meta.model.ser.ValidatorJsonSerializer;
import com.sk.tools.excel.validator.Validator;

import java.util.List;

public class ColumnMeta {
    private int index;
    private String name;
    private String type;
    private String comment;

    @JsonDeserialize(contentUsing = ValidatorJsonDeserializer.class)
    @JsonSerialize(contentUsing = ValidatorJsonSerializer.class)
    private List<Validator> validtors;

    public int getIndex() {
        return index;
    }

    public void setIndex(int index) {
        this.index = index;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getType() {
        return type;
    }

    public void setType(String type) {
        this.type = type;
    }

    public String getComment() {
        return comment;
    }

    public void setComment(String comment) {
        this.comment = comment;
    }

    public List<Validator> getValidtors() {
        return validtors;
    }

    public void setValidtors(List<Validator> validtors) {
        this.validtors = validtors;
    }

    enum ColumnType{
        STRING,DATE,INT,DATETIME
    }


    @Override
    public String toString() {
        return "ColumnMeta{" +
                "index=" + index +
                ", name='" + name + '\'' +
                ", type='" + type + '\'' +
                ", comment='" + comment + '\'' +
                ", validtors=" + validtors +
                '}';
    }
}
